import threading
import time
import tkinter
from tkinter import *

import win32api

import win32con

from Tkinter.thread_kill import stop_thread

root = Tk()
text1 = Text(root, height=40, width=70)
photo=PhotoImage(file="huozhan.gif")
text1.insert(END,'\n')
text1.image_create(END, image=photo)

text1.pack(side=LEFT)

text2 = Text(root, height=40, width=70)
scroll = Scrollbar(root, command=text2.yview)
text2.configure(yscrollcommand=scroll.set)
text2.tag_configure('bold_italics', font=('Arial', 13,))
text2.tag_configure('big', font=('Verdana',20, 'bold'))
text2.tag_configure('color', foreground='#476042',
                        font=('Tempus Sans ITC', 18, 'bold'))
text2.tag_bind('follow', '<1>', lambda e, t=text2: t.insert(END, "Not now, maybe later!"))
text2.insert(END,'\n 云之商科技 - 货栈web端自动化测试 \n', 'big')
quote = """
  -----------模拟用户登陆测试-----------
"""
text2.insert(END, quote, 'color')
text2.insert(END, '\n   '+'case_text'+'\n', 'bold_italics')
text2.pack(side=LEFT)
scroll.pack(side=RIGHT, fill=Y)

#显示倒计时Label
lbTime = tkinter.Label(root,fg='red',anchor = 'w')
lbTime.size()
lbTime.place(x=495,y=500,width=495)

def autoClose():
    for i in range(5):
        lbTime['text'] = '距离窗口关闭还有{}秒'.format(5-i)
        time.sleep(1)
    root.destroy()

t=threading.Thread(target=autoClose)
t.setDaemon(True)
t.start()
root.mainloop()
stop_thread(t)
t.join()

